<?php include '../../authorization_check.php' ?>
<?php include '../../checkSecretaryOnly.php' ?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9">
<title>View Active Sections</title>
<SCRIPT TYPE="text/javascript" src= "../../commonutils/util/util.js"> </SCRIPT>
</head>
<style type="text/css">

</style>
<body>

<?php include 'top.html' ?>
<?php include 'notifier.php' ?>

<p>
  
<table border=1 cellpadding=3>
<tr>
<th>COURSE CODE</th>
<th>COURSE NAME</th>
<th>SECTION NUMBER</th>
<th>INSTRUCTOR</th>
<th>LECTURE DAY</th>
<th>BEGIN TIME</th>
<th>HOURS</th>
<th>ROOM</th>
</tr>
<?php
  require_once '../../commonutils/db/DBConnectionManager.php';


  $sqlquery = " select s.sectionID, c.courseCode, c.courseName, s.sectionNumber, s.instructorID, ".
  				" s.roomCode, s.beginTime, s.hours, s.lectureDay, concat(i.firstName, ' ', i.lastName) as iname  ".
				" from course c, section s, instructor i ".
				" where s.courseCode = c.courseCode  and i.instructorID = s.instructorID ".
  				" and s.semesterID = ".$semesterID." and c.programCode = ".$programCode;
 //// echo $sqlquery;
 $result = DBConnectionManager::query($sqlquery);
 
  
  while($row = mysql_fetch_assoc($result)){
  	    if($row['lectureDay'] == 1) $lectureDay = "Monday";
		else if($row['lectureDay'] == 2) $lectureDay = "Tuesday";
		else if($row['lectureDay'] == 3) $lectureDay = "Wednesday";		
		else if($row['lectureDay'] == 4) $lectureDay = "Thursday";
		else if($row['lectureDay'] == 5) $lectureDay = "Friday";		
		else if($row['lectureDay'] == 6) $lectureDay = "Saturday";
		else if($row['lectureDay'] == 7) $lectureDay = "Sunday";		
		
		
		echo "<tr>";
		echo "<td>".$row['courseCode']." &nbsp;</td>";
		echo "<td>".$row['courseName']." &nbsp;</td>";
		echo "<td>".$row['sectionNumber']."     &nbsp;</td>";
		echo "<td>".$row['iname']."&nbsp;</td>";
		echo "<td>".$lectureDay." &nbsp;</td>";
		echo "<td>".$row['beginTime']."&nbsp;</td>";
		echo "<td>".$row['hours']." &nbsp;</td>";
		echo "<td>".$row['roomCode']."&nbsp;</td>";
		echo "</tr>";		
  }
 
 
?>

</table>
</p>

<?php include 'bottom.php' ?>

</body>


</html>